# makefile for Chips440; after running 'make all', you ought to be able to
# run the game by running 'java chips440.main.Chips440'

JC = javac
JR = java
CWD := $(shell pwd)/chips440
SERVER_CD= chips440n_server
PORT=2048
CP = -classpath $(CWD)/main/:$(CWD)/internals/:$(CWD)/tiles/:$(CWD)/client/:$(CWD)/server/:


.SUFFIXES: .java .class

## this actually makes a jar file that can be shipped off to whatever box you
## like to make it act as the server
server_jar:
	mkdir $(SERVER_CD)
	$(JC) $(CP) -d $(SERVER_CD) -Xlint chips440/server/Server.java
	jar cfm server.jar server_manifest.txt -C $(SERVER_CD) .
	rm -rf $(SERVER_CD)

server: server_jar
	java -jar server.jar 2048

run: all
	$(JR) chips440.client.Client

all:
	$(JC)  $(CP) -Xlint:unchecked chips440/*/*.java

javadoc:
	rm -rf javadoc
	mkdir javadoc
	javadoc -private -d javadoc chips440/*/*.java

clean:
	rm -rf javadoc
	rm -rf chips440/*/*.java~
	rm -rf chips440/*/*.class
	rm -rf $(SERVER_CD)
	rm -f *.jar

default: all
